package com.web.star;

import java.util.Properties;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import com.github.pagehelper.PageHelper;

@SpringBootApplication
@MapperScan("com.web.star.mapper")
public class StarApplication {

	public static void main(String[] args) {
		SpringApplication.run(StarApplication.class, args);
	}
	
	
	@Bean
	public PageHelper pageHelper() {
	    PageHelper pageHelper = new PageHelper();
	    Properties p = new Properties();
	    p.setProperty("offsetAsPageNum", "true");
	    p.setProperty("rowBoundsWithCount", "true");
	    p.setProperty("reasonable", "true");
	    p.setProperty("dialect", "mysql");
	    p.setProperty("supportMethodsArguments", "false");
	    p.setProperty("pageSizeZero", "true");
	    pageHelper.setProperties(p);
	    return pageHelper;
	}
}
